/*邮箱验证*/
function email(email,id){
	var emails = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	if(!emails.test(email)){
		$(id).tips({
			side:3,
            msg:'邮箱格式不正确',
            bg:'#AE81FF',
            time:1
        });
		$(id).focus();
		return false;
	}
	return true;
}
/*手机号码验证*/
function mobile(mobile,id){
	var mobiles = /^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|17[6|7|8]|18[0|1|2|3|5|6|7|8|9])\d{8}$/;
	if(!mobiles.test(mobile)){
		$(id).tips({
			side:3,
            msg:'手机号码格式不正确',
            bg:'#AE81FF',
            time:1
        });
		$(id).focus();
		return false;
	}
	return true;
}

/*身份证验证*/
function identitys(identity,id){
	var isIDCard1=/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/;
	var isIDCard2=/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
	if(!(isIDCard1.test(identity)||isIDCard2.test(identity))){
		$(id).tips({
			side:3,
            msg:'身份证格式错误',
            bg:'#AE81FF',
            time:1
        });
		$(id).focus();
		return false;
	}
	return true;
}


/*密码验证*/
function identity(password,id){
	var passwords=/^[a-zA-Z]\w{5,17}$/;
	if(!passwords.test(password)){
		$(id).tips({
			side:3,
            msg:'密码格式错误',
            bg:'#AE81FF',
            time:1
        });
		$(id).focus();
		return false;
	}
	return true;
}
